load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "evaluator",
    hdrs = ["evaluator.h"],
    deps = [
        ":prover",
        "//tachyon/zk/plonk/vanishing:circuit_polynomial_builder_forward",
        "//tachyon/zk/plonk/vanishing:graph_evaluator",
        "//tachyon/zk/plonk/vanishing:vanishing_utils",
    ],
)

tachyon_cc_library(
    name = "opening_point_set",
    hdrs = ["opening_point_set.h"],
)

tachyon_cc_library(
    name = "permute_expression_pair",
    hdrs = ["permute_expression_pair.h"],
    deps = [
        "//tachyon/base:parallelize",
        "//tachyon/base:sort",
        "//tachyon/math/base:parallelize_threshold",
        "//tachyon/zk/base/entities:prover_base",
        "//tachyon/zk/lookup:pair",
        "@com_google_absl//absl/container:btree",
    ],
)

tachyon_cc_library(
    name = "prover",
    hdrs = [
        "prover.h",
        "prover_impl.h",
    ],
    deps = [
        ":opening_point_set",
        ":permute_expression_pair",
        "//tachyon/base:profiler",
        "//tachyon/base:ref",
        "//tachyon/base/containers:container_util",
        "//tachyon/crypto/commitments:polynomial_openings",
        "//tachyon/zk/base/entities:prover_base",
        "//tachyon/zk/lookup:argument",
        "//tachyon/zk/plonk/base:multi_phase_ref_table",
        "//tachyon/zk/plonk/expressions:compress_expression",
        "//tachyon/zk/plonk/expressions:proving_evaluator",
        "//tachyon/zk/plonk/permutation:grand_product_argument",
        "@com_google_absl//absl/types:span",
    ],
)

tachyon_cc_library(
    name = "scheme",
    hdrs = ["scheme.h"],
    deps = ["//tachyon/zk/lookup:type"],
)

tachyon_cc_library(
    name = "utils",
    hdrs = ["utils.h"],
    deps = [
        "//tachyon/base:logging",
        "//tachyon/zk/lookup:type",
    ],
)

tachyon_cc_library(
    name = "verifier",
    hdrs = ["verifier.h"],
    deps = [
        ":opening_point_set",
        ":verifier_data",
        "//tachyon/crypto/commitments:polynomial_openings",
        "//tachyon/zk/lookup:argument",
        "//tachyon/zk/plonk/base:l_values",
        "//tachyon/zk/plonk/expressions:verifying_evaluator",
        "//tachyon/zk/plonk/halo2:proof",
    ],
)

tachyon_cc_library(
    name = "verifier_data",
    hdrs = ["verifier_data.h"],
    deps = [
        "//tachyon/zk/lookup:pair",
        "//tachyon/zk/plonk/base:multi_phase_evaluations",
    ],
)

tachyon_cc_unittest(
    name = "halo2_unittests",
    srcs = ["permute_expression_pair_unittest.cc"],
    deps = [
        ":permute_expression_pair",
        "//tachyon/base:random",
        "//tachyon/zk/plonk/halo2:bn254_shplonk_prover_test",
    ],
)
